package com.restaurant.application.indexes.couponmanagelist.support;

import com.nebutown.base.ViewSpec;
import com.nebutown.base.data.ViewUpdate;
import com.nebutown.description.data.UnitForGeneration;
import com.nebutown.generation.PickableBean;
import com.nebutown.generation.basictype.UID;
import com.nebutown.supporthome.AbstractBase;
import com.nebutown.supporthome.CmdCapsule;
import com.restaurant.application.couponmanage.support.CouponManageData;
import com.restaurant.application.indexes.couponmanagelist.AssistCouponManageListImpl;
import com.restaurant.application.indexes.couponmanagelist.mysql.CouponManageListBean;
import com.restaurant.application.indexes.couponmanagelist.mysql.CouponManageListCriteria;

public class AssistCouponManageListBase extends AbstractBase {
    private UnitForGeneration desc = new UnitForGeneration();

    public AbstractAssistCouponManageList getImpl() {
        AbstractAssistCouponManageList inst = new AssistCouponManageListImpl();
        inst.setBase(this, getEscort());
        return inst;
    }

    @Override
    public AssistCouponManageListOutFace getUnitFace() {
        return new AssistCouponManageListOutFace(this);
    }

    @Override
    protected Object callDistr(String name, Object... param) {
        switch(name) {
            case "createBean":
                return getImpl().createBean((UID) param[0], (CouponManageData) param[1]);
            case "getAllNormal":
                return getImpl().getAllNormal();
            case "updateBean": return getImpl().updateBean((UID)param[0], (CouponManageData)param[1], (CouponManageListBean)param[2]);
            case "getId": return getImpl().getId();
            case "getViewLead": return getImpl().getViewLead((ViewSpec)param[0]);
            case "getFullView":
                setIsRefresher();
                return getImpl().getFullView();
            case "getEffectiveInterface":
                return getImpl().getEffectiveInterface();
        }
        return null;
    }

    @Override
    protected boolean authDistr(String name) {
        switch(name) {
        }
        return true;
    }

    @Override
    public CmdCapsule getUICall(int cmd) {
        switch(cmd) {
            case 0: return AbstractAssistCouponManageList.CMD_DELETE;
            case 1: return AbstractAssistCouponManageList.CMD_SEARCH;
            case 2: return AbstractAssistCouponManageList.CMD_MODIFY;
            case 3:
                return AbstractAssistCouponManageList.CMD_CRATECD;
            case 4:
                return AbstractAssistCouponManageList.CMD_CRATECS;
            case 5:
                return AbstractAssistCouponManageList.CMD_CRATECL;
        }
        return null;
    }

    @Override
    public ViewUpdate uiCall(int cmd, PickableBean param, int... seq) {
        switch(cmd) {
            case 0: return getImpl().delete((DeleteData)param, seq);
            case 1: return getImpl().search((CouponManageListCriteria)param, seq);
            case 2: return getImpl().modify(seq);
            case 3:
                return getImpl().crateCD(seq);
            case 4:
                return getImpl().crateCS(seq);
            case 5:
                return getImpl().crateCL(seq);
        }
        return null;
    }
}
